U.S. stocks swung on Monday as oil prices kept climbing because of uncertainty about when the war with Iran could end.