Markets steadied after President Donald Trump signalled the conflict with Iran could be nearing its end.