US stocks have finished higher as Donald Trump's oil market stabilisation efforts provided some relief to investors concerned about the Middle East conflict.