Chevron jumped 4 percent, the most in the Dow Jones industrial average. Exxon Mobil also gained 3 percent.
Energy stocks climbed as the price of oil turned higher, shaking off a two-day slump. U.S. crude gained 2 percent.
Banks and other financial stocks were the only sector to fall.
The Dow gained 200 points, or 1.2 percent, to 16,472. It was down as much as 258 earlier.