Stocks edged higher on Wednesday after a weekly decline in crude inventories supported oil above $51 a barrel. 

The S&P 500 was up 0.27%, the Dow Jones Industrial Average climbed 0.37%, and the Nasdaq was flat.

Crude oil prices jumped on Wednesday on signs of falling domestic production. A weekly reading on domestic inventories from the Energy Information Administration showed a decline of 5.2 million barrels. Inventories have fallen six times in the past seven weeks. A separate reading from the American Petroleum Institute showed a decline of 3.8 million barrels in the week ended Oct. 14. 

China's crude production fell 9.8% to 3.89 million barrels per day in September, its second-largest year-on-year drop ever. Current levels are at their lowest in six years. Low crude prices have driven many Chinese producers to lower production.

Upbeat comments from Saudi Arabia, one of the largest producers in the Organization of Petroleum Exporting Countries, also boosted prices. Saudi Arabian Energy Minister Khalid al-Falih said that oil has reached the end of a downturn and that supply-demand forces were beginning to rebalance. al-Falih also called on non-OPEC producers to help to limit production as OPEC does their part.

West Texas Intermediate crude was oil up 3% to $51.83 a barrel on Wednesday morning.

Halliburton (HAL - Get Report) moved 5% higher after swinging to an unexpected quarterly profit. The oil-services company earned an adjusted 1 cent a share over the quarter, up from a loss of 6 cents a share in the year-ago quarter and better than an estimated loss of 6 cents a share. Halliburton said it remains "cautious around fourth quarter customer activity due to holiday and seasonal weather-related downtimes."

Morgan Stanley (MS - Get Report) rose as trading revenue drove the bank to beat estimates in its third quarter. Bond-trading revenue increased 61% over the quarter, its largest gain among the Wall Street banks already reported, as investors played the market on speculation over the next interest rate hike. Profit of 81 cents a share breezed past estimates of 63 cents.

Intel (INTC - Get Report) exceeded earnings estimates in its third quarter after posting a 21% increase in net profit and 9% jump in revenue. However, shares tumbled 6% after guiding for a below-consensus fourth quarter. The tech company anticipates fourth-quarter revenue of $15.7 billion with a $500 million buffer on either side, below an estimated $15.86 billion at consensus' midpoint. Intel pointed to costs tied to accelerating production of new memory products and factory startup costs associated with 10-nanometer manufacturing. The stock fell 4.8%.

Yahoo! (YHOO) moved more than 2% higher after topping earnings estimates in its third quarter. The Internet company earned an adjusted 20 cents a share over its recent quarter, 6 cents above forecasts. Revenue rose nearly 6% to $1.31 billion, in line with consensus. After subtracting advertising commissions, Yahoo!'s revenue in the quarter fell 14% to $857 million, its fourth straight quarter with declines of at least 10%. Verizon (VZ - Get Report) is set to purchase Yahoo! for $4.8 billion after announcing a deal in July, though some have called its likelihood into question after a recently disclosed data breach that impacted more than 500 million accounts.

Seagate  (STX - Get Report) fell 4% after warning of increasing expenses in its first quarter. The hard-drive manufacturer expects operating costs to increase to $580 million in its first quarter despite continued cost-cutting measures. Expected higher expenses were tied to performance-based compensation costs. 

Housing starts slid in September as activity fell back from recent highs. Builders began construction on 9% fewer homes last month, the slowest pace since March 2015. Housing starts moved lower to an annual 1.047 million pace, weaker than consensus of 1.18 million. Weakness was driven by a 38% decline in multi-family starts, bottoming at a three-year low, while single-family housing starts jumped more than 8%. Building permits jumped 6.3%, a positive sign of future strength.

Investors awaited the release of the Federal Reserve's "Beige Book" out Wednesday afternoon. The anecdotal read on economic growth over a six-week period provides insight into economic activity in the 12 Fed districts.

"We expect the Fed's Beige Book to reflect an economy that's growing modestly, accompanied by rising wage and price pressure amid growing consumer and business anxiety ahead of the U.S. presidential election next month," said John Canally, chief economic Strategist for LPL Financial.

It's also a busy day of Fedspeak with San Francisco Fed President John Williams to participate in a Q&A, Dallas Fed President Rob Kaplan to make remarks in Fort Worth, Texas, and New York Fed President William Dudley to address the Lotos Club in New York City.

"We expect the overall thrust to guide towards a December hike," BNP Paribas analysts wrote in a note. "Given the emerging debate over the degree of slack in the labor market, we are also looking for insight into differences of opinion about of how close the economy is to full employment."

Rite Aid (RAD - Get Report) fell 5% on reports Kroger (KR - Get Report) will not buy some of the stores it needs to sell in order to comply with antitrust conditions tied to its Walgreens (WBA - Get Report) deal. The Federal Trade Commission reportedly told Kroger that it would not be able to close the stores and move operations within Kroger locations, according to the New York Post

Walgreens is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells WBA? Learn more now.

Wells Fargo (WFC - Get Report) was downgraded to market perform from outperform at FBR Capital Markets. The firm said regulatory investigations will likely keep a lid on the stock. The bank has been under scrutiny since an investigation revealed it had opened two million unauthorized customer accounts to gin up sales numbers. 

Wells Fargo is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells WFC? Learn more now.

Yum! Brands (YUM - Get Report) was upgraded to outperform from neutral at Credit Suisse. Analysts said the company's non-China business should post higher earnings and see a multiple expansion in the next couple of years.