The Dow Jones industrial average closed up 56.14 points, or 0.4 percent, to close at 14,988.55.
The Standard & Poor's 500 rose 1.33 points, or 0.1 percent, to 1,615.41. The Nasdaq composite gained 10.27 points, or 0.3 percent, to 3,443.67.
Trading closed at 1 p.m. ahead of the July Fourth holiday. Regular trading will resume Friday.
Investors will be watching the government's jobs report closely in hopes of figuring out what the Federal Reserve will do next.
Fed Chairman Ben Bernanke said June 19 that the central bank was considering easing back on its stimulus program this year if the economy strengthens enough. The central bank is buying $85 billion in bonds every month to keep interest rates low and encourage spending.
The yield on the 10-year Treasury note was unchanged at 2.48 percent from Tuesday.
Benchmark oil rose $1.64, or 1.7 percent, to $101.24 a barrel on the New York Mercantile Exchange. It rose to $102.18 a barrel earlier, its highest price since last May. Oil has climbed almost 8 percent since Monday last week. The price of gold rose $8.50, or 0.7 percent, to close at $1,251.90.
Among stocks making big moves:
Alcoa fell 9 cents, or 1.2 percent, to $7.71 after Citigroup analyst Brian Yu reduced his second-quarter and full-year profit predictions for the aluminum producer, citing low prices for the metal.
AutoNation gained 71 cents, or 1.6 percent, to $45.27 after Credit Suisse raised its rating on the stock to "outperform" from "neutral," citing a positive outlook for the company's parts and servicing business.
Mead Johnson fell $6.05, or 8.1 percent, to $68.85, adding to a 5.7 percent slump Tuesday. The Chinese government is investigating the nutritional-products maker for possibly violating antimonopoly laws in its pricing of infant formula, Bloomberg News reported Tuesday.