U.S. crude-oil prices surged toward $50 a barrel, extending a rally that has helped send the energy sector to the top of the S&P 500 this year.
Wednesday’s gains came after data showed that U.S. crude stockpiles fell for the fifth consecutive week. Oil prices have been rising since the Organization of the Petroleum Exporting Countries tentatively agreed last week to cut production.
U.S. crude futures for November delivery rose by $1.14, or $2.3%, to $49.83 a barrel on the New York Mercantile Exchange—the highest settlement price since late June.
Oil’s rebound from as low as $26.21 earlier this year has relieved some of the pressure on oil companies. Energy shares have risen more than 16% in the S&P 500 so far this year, outperforming the other 10 sectors.
Investors have been selling some of 2016’s other winners, including income-generating stocks such as telecommunications and utilities companies. The utilities sector was up 21% for the year as of June 30, but has since pared its gains to 8.9%.
Investors turned to such stocks for income instead of bonds as yields around the world sank, said Adrian Cronje, chief investment officer at Balentine LLC. “The psychology for much of this year had been turned on its head.”
But recent decisions by the European Central Bank and the Bank of Japan, while accommodating, indicate that central-bank policy will no longer be “expansionary at all costs,” Mr. Cronje said. In the U.S., a string of solid economic indicators is building investor consensus that the Federal Reserve will raise rates before year-end, he said.
“The stronger economic data is provoking a rotation in the equity market,” Mr. Cronje said. “It’s a return to normalization of the markets.”
On Wednesday, a gauge of U.S. service-sector activity rose to its highest level since October 2015. Earlier this week, the Institute for Supply Management’s manufacturing index showed a return to growth in September.
Financial shares also have benefited from the recent shift away from safer stocks and, along with energy companies, helped major U.S. indexes snap a two-day losing streak Wednesday.
The Dow Jones Industrial Average rose 112.58 points, or 0.6%, to 18281.03. The S&P 500 gained 9.24 points, or 0.4%, to 2159.73 and the Nasdaq Composite added 26.36 points, or 0.5%, to 5316.02.
Financial shares rose 1.5% in the S&P 500 and energy shares gained 1.4%.
Chesapeake Energy Corp. was the biggest percentage gainer in the S&P 500, rising 43 cents, or 6.8%, to $6.80. Its shares are up 51% so far this year.
Chevron rose 96 cents, or 0.9%, to 102.23 and Exxon Mobil added 75 cents, or 0.9%, to 87.00. They are up 14% and 12%, respectively, in 2016.
Earnings expectations for energy firms remain muted, but “macroeconomic conditions and data are showing that supply is declining,” said Ted Harper, portfolio manager at Frost Investment Advisors.
Data from the Energy Information Administration on Wednesday showed that U.S. crude supplies fell by three million barrels in the week ended Sept. 30. Analysts surveyed by The Wall Street Journal had expected the agency to report an increase in crude supplies.
Still, a persistent global glut of crude and lingering doubts that an OPEC deal will materialize could keep pressure on prices, some analysts say.
And energy companies are expected to weigh on third-quarter earnings results for the S&P 500. As of Sept. 30, analysts polled by FactSet estimated the energy sector would report an earnings decline of 67% from a year earlier. Excluding energy companies, estimated earnings growth for the S&P 500 would improve to 1.2% from minus-2.1%, according to FactSet.
Elsewhere, the Stoxx Europe 600 fell 0.5% after six successive sessions of gains, with real-estate and utilities companies among the worst performers.
Japan’s Nikkei Stock Average rose 0.5% as a weaker yen supported shares of export-heavy car makers, while the Hang Seng rose 0.4%. The dollar was up 0.6% against the yen at ¥103.500.
Australia’s S&P/ASX 200 fell 0.6% as mining companies took a hit from gold’s steep fall in the previous session. Markets in China were closed.