US stocks close higher after Trump extends ceasefire with Iran, earnings boost sentiment