A crude oil rally helped Wall Street rally on Wednesday to erase all losses endured a day earlier. 

The S&P 500 was up 0.43%, the Dow Jones Industrial Average gained 0.62%, or 112 points, and the Nasdaq increased 0.50%. Stocks had fallen on Tuesday as gold slumped and on worries the European Central Bank might reduce easing sooner than expected. 

Crude oil jumped after U.S. crude stockpiles showed an unexpected decrease in the past week. The Energy Information Administration reported a decline of 3 million barrels of crude, better than a forecast 2.6-million-barrel increase. A separate reading from the American Petroleum Institute showed a drop of 7.6 million barrels in the past week.

West Texas Intermediate crude oil was up 2.01% to $50.29 a barrel on Wednesday, closing at its highest level since June 29. Crude has not touched $50 a barrel since June.

The energy sector was the best performer on markets Wednesday. Major oilers including Exxon Mobil(XOM) - Get Report , Chevron(CVX) - Get Report , Royal Dutch Shell (RDS.A) and PetroChina(PTR) - Get Report moved higher, while the Energy Select Sector SPDR ETF (XLE) - Get Report added 1.5%.

The U.S. economy added 154,000 jobs to private payrolls last month, according to the ADP National Employment Report. The measure came in below consensus of 170,000. The U.S. economy added 177,000 jobs in August.

"The current record of consecutive monthly job gains continued in September," Mark Zandi, chief economist of Moody's Analytics, wrote in a note. "With job openings at all-time highs and layoffs near all-time lows, the job market remains in full-swing. Job growth has moderated in recent months, but only because the economy is finally returning to full-employment."

ADP's report tends to show a larger increase in the number of jobs added to the U.S. economy than the official report, though it is a good broad indicator of the health of the labor market month to month. The official Labor Department report will be released on Friday morning.

It was a busy day for economic data. Services activity increased at a far-faster pace than expected in September, according to the ISM Non-Manufacturing Index. The index increased to an 11-month high as both new orders and business activity climbed. Factory orders in August showed an unexpected increase, according to the Census Bureau. The gains were a positive sign factory activity is recovering from a slowdown earlier in the year.

The U.S. trade deficit was $40.7 billion in August, wider than an anticipated $39 billion deficit. U.S. imports increased 1.2% in August, an 11-month high, while U.S. exports increased 0.8% to a 13-month high.

Gold prices stabilized on Wednesday after hitting their lowest level since the late-June Brexit vote on Tuesday. Spot gold fell 3% on Tuesday, breaching the key support level of $1,300 an ounce and suffering its worst one-day percentage decline since December 2013. Prices had slumped as the U.S. dollar marched to a two-month high.

"The selling pressure had been accumulating over the past several days, or weeks even, as market participants apparently moved back to the racier equity markets and away from perceived safe haven assets," said Fawad Razaqzada, technical analyst at FOREX.com. "Meanwhile the dollar rose on the back of improvement in US data and this weighed further on the buck-denominated metal." 

Government consulting contractor Booz Allen Hamilton(BAH) - Get Report fell by more than 3% on Wednesday afternoon on reports the Federal Bureau of Investigations had arrested a contractor in August over a potential leak of classified materials. The FBI is currently investigation whether the contractor had disclosed classified hacking codes, according to The New York Times. The contractor reportedly worked for consulting firm Booz Allen Hamilton.

Acuity Brands(AYI) - Get Report slid 4% after revenue and profit in its recent quarter came in weaker than expected. The lighting company earned an adjusted $2.21 a share in its August-ended quarter, below estimates of $2.39. Revenue increased 22% to $925.5 million, but fell short of estimates of $947 million.

Netflix(NFLX) - Get Report jumped nearly 4% on Wednesday after signing a deal to screen its original movies at iPic Entertainment locations at the same time they launch on the streaming platform. Original content will screen in Los Angeles and New York. Shares climbed earlier in the week on reports Walt Disney(DIS) - Get Report was contemplating an acquisition offer.

Micron Technology(MU) - Get Report  declined by less than 1% after swinging to a loss in its fiscal fourth quarter. The chipmaker reported a net loss of 16 cents a share over the quarter compared to profit of 42 cents a share a year earlier. An adjusted loss of 5 cents a share came in better than an expected loss of 12 cents. Revenue declined 10.6%.

Twitter(TWTR) - Get Report remained on watch as rumors continued to swirl that the social network was accepting bids this week. Salesforce.com(CRM) - Get Report is reportedly one of the potential bidders making a case to the company. Salesforce shares slumped by nearly 6%.

Eli Lilly(LLY) - Get Report moved slightly higher after its Elanco division agreed to acquire Boehringer Ingelheim Vetmedica's U.S. rabies vaccine business for $885 million. The purchase strengthens Elanco's companion animal operations. The deal is expected to close early next year.

Constellation Brands(STZ) - Get Report increased 2% after topping sales and profit estimates in its second quarter. The beer and spirits company earned an adjusted $1.77 a share, better than an anticipated $1.65, while revenue climbed 17% to $2.02 billion. Constellation also boosted its full-year profit guidance above forecasts.

Monsanto (MON) moved higher by nearly 2% after posting a surprise profit in its fiscal fourth quarter. The agricultural company earned an adjusted 7 cents a share, better than consensus of a loss of 5 cents. Monsanto also expects adjusted full-year earnings of at least $4.50 a share, above estimates of $4.42.