Stocks rose on Wednesday, while oil prices declined to start the month, as hope grew that an end to the U.S.-Iran war was on the horizon.