U.S. stocks end at record highs as oil prices gain