U.S. stocks closed sharply higher Wednesday, after a more than 2 percent gain from the energy sector led the S&P 500 higher for the second straight session. Shares of Netflix Inc. (NASDAQ:NFLX) soared more than 13 percent in after-hours trading to an all-time high of $537.18 after the movie streaming service reported quarterly earnings that missed forecasts, but subscriptions topped Wall Street expectations.

The Dow (INDEXDJX:.DJI) climbed 75.91 points, or 0.42 percent, to close at 18,112.61. The Standard & Poor's 500 (INDEXNASDAQ:.IXIC) added 10.79 points, or 0.51 percent, to end at 2,106.63. The Nasdaq composite (INDEXSP:.INX) rose 33.73 points, or 0.68 percent, to finish at 5,011.02. 

Netflix turned in first-quarter net income of $24 million, or earnings per share of 38 cents, on revenue of $1.57 billion, compared with a profit of $53.12 million, or earnings per shares of 86 cents on sales of $1.27 billion a year ago.

Wall Street had expected the company to report net income of $39 million, or earnings per share of 63 cents, on revenue of $1.57 billion, according to analysts polled by Thomson Reuters.

However, Netflix added 2.3 million new members, beating estimates of 1.88 million.

Shares of Intel (NASDAQ:INTC) rallied more than 4 percent Wednesday, boosting the Dow, after the world’s largest maker of semiconductors posted earnings in line with Wall Street expectations a day earlier, despite sluggish sales in its personal computer business. 

The S&P 500 energy sector rallied more than 2 percent Wednesday, led by a more than 8 percent gain from Consol Energy Inc., a producer of coal and natural gas for global energy and raw materials markets.

Much of the rally in the energy sector Wednesday was driven by a jump in oil prices of 5 percent after U.S. stockpiles rose by 1.29 million barrels to 483.69 million barrels in the week to April 10, the U.S. Energy Information Administration reported Wednesday. The 1.29 million barrel rise was a less-than-expected increase of 1.3 million barrels in weekly inventories.

West Texas Intermediate crude, the benchmark for U.S. oil prices, gained 5.8 percent to $56.39 a barrel, for May 15 delivery, on the New York Mercantile Exchange. Brent crude, the benchmark for global oil prices, rose $1.60 to $60 a barrel, for May 15 delivery, on the London ICE Futures Exchange.

Economists are looking ahead to Thursday’s economic calendar, which includes weekly jobless claims, or the number of Americans filing new claims for unemployment. Initial claims for state unemployment benefits increased by 14,000 to a seasonally adjusted 281,000 in the week ended April 4, the Labor Department said last week.

Economists expect jobless claims fell 1,000 to 280,000 last week, according to analysts polled by Thomson Reuters.