US stocks rallied after President Donald Trump’s announcement of a two-week ceasefire in the Iran war spurred relief across markets.