The price of US crude was up 56 cents to $44.67 a barrel, helping to lift shares in oil giant Chevron by 1.9%.
The Dow Jones rose 229.09 points to 16,600.05, while the S&P 500 added 25.06 points to 1,978.09. The Nasdaq was up by 54.76 points at 4,860.52.
Investors are expected to remain cautious ahead of Thursday's Federal Reserve meeting.
Analysts are still split over whether the Fed will decide to raise rates for the first time in nine years.
The latest economic data showed that US retail sales rose 0.2% last month, which was slightly below forecasts.
So-called core retail sales - which exclude cars, fuel, building materials and food services - were up 0.4% in August.
Separate figures showed that US manufacturing output fell by 0.5% in August, the sharpest decline since January 2014.
The drop was mostly caused by carmakers cutting back production, with car output down 6.4%, the biggest fall for three years.
(Close): US markets closed higher, with energy stocks leading the way following a rise in the price of oil.