US stocks hit record highs after strong earnings, but oil prices rose over the Iran war, despite US President Donald Trump extending the ceasefire.