Stocks were back near highs by Thursday afternoon as a rally in energy stocks offset a selloff in the health care sector.

The S&P 500 was up 0.7%, the Dow Jones Industrial Average climbed 0.47%, and the Nasdaq increased 1%.

Crude oil jumped on reports Russian Energy Minister Alexander Novak had spoken with Saudi Arabian officials to cut production by up to 5% in light of weaker prices. Novak also said members of the Organization of Petroleum Exporting Countries and non-member countries had proposed a future meeting to discuss strategy given a weaker commodities environment, according to Reuters. West Texas Intermediate crude oil jumped 3.4% to $33.39 a barrel.

"While the potential for a significant bullish stimulus exists in this situation, diplomatic and strategic obstacles -- notably Russia and Saudi Arabia's differing views on the Syrian government and the latter's obstinate dedication to the defense of market share -- will prove major hindrances to cooperation," T. Austin Sapp, commodity analyst at Schneider Electric, wrote in a note.

The energy sector was the best performer as large-cap oilers including Exxon Mobil (XOM) , Chevron (CVX) , Schlumberger (SLB) , and ConocoPhillips (COP) jumped. The Energy Select Sector SPDR ETF (XLE) rose 2.8%.

A number of disappointing earnings reports and softer-than-expected guidance from health care stocks including Celgene (CELG) and Eli Lilly (LLY) dragged on the broader sector. Health care was the worst performer on markets Thursday with major drugmakers Pfizer (PFE) , Merck (MRK) , Gilead Sciences (GILD) and Bristol-Myers Squibb (BMY) lower. The Health Care SPDR ETF (XLV) tumbled 1.9%.

It was a busy morning for earnings reports with heavy-hitters such as Facebook (FB) active after reporting on their recent quarters.

Facebook jumped 15% after reaching $1 billion in quarterly profit for the first time. The social network beat analysts' estimates on its top- and bottom-lines with results driven by increased advertising demand.

Facebook is a holding in Jim Cramer's Action Alerts PLUS charitable trust portfolio.

You see Jim Cramer on TV. Now, see where he invests his money and why Facebook is a core holding of his multi-million dollar portfolio.

Want to be alerted before Jim Cramer buys or sells FB? Learn more now. 

Deutsche Bank (DB) tumbled 3% after closing out 2015 with a loss, its first since 2008. The bank reported a loss of 1.15 billion euros in its fourth quarter compared to a net profit of 323 million euros a year earlier.

Under Armour (UA) surged 19% after exceeding fourth-quarter expectations and issuing strong growth prospects for the full year. The athletic apparel retailer said it expects revenue of $4.95 billion for fiscal 2016, above estimates of $4.91 billion.

eBay (EBAY) tumbled 14% after it reduced first-quarter guidance. The online auction site said it expects earnings between 43 cents and 45 cents a share in its current quarter, below forecasts of 48 cents a share.

PayPal (PYPL) climbed 7.4% following better-than-expected earnings. The payments-processing company earned 36 cents a share, 2 cents above estimates, while revenue of $2.56 billion exceeded forecasts of $2.51 billion.

PayPal is a holding in Jim Cramer's Action Alerts PLUS charitable trust portfolio.

Pending home sales came in weaker than expected in December. The index measuring the number of deals in which a contract has been signed but a purchase not yet closed climbed to 106.8 in December, up from 106.7 in November.

Durable goods orders in the U.S. contracted at a much faster pace than expected in December as the U.S. economy saw a slight slowdown to close out 2015. The drop was driven by less demand for aircraft and parts, both in the defense and non-defense industries.

The labor market continued to show resilience after initial claims for unemployment benefits fell 16,000 to 278,000 in the week ended Jan. 23. Economists had expected the number of new claims to fall to 285,000.

Stocks slumped to session lows in the final hours of trading on Wednesday following the release of the Federal Reserve's statement from its latest policy meeting. The central bank kept a potential March rate hike in play. However, it did downgrade its outlook for U.S. household spending and business investment and noted that economic growth slowed to end last year.

More from Markets

North Korea, Apple, GPDR and Gap - 5 Things You Must Know

North Korea, Apple, GPDR and Gap - 5 Things You Must Know

Oil Falls Sharply After Saudi Arabia, Russia Suggest Production Cut Easing

Oil Falls Sharply After Saudi Arabia, Russia Suggest Production Cut Easing

Netflix Ready to Surpass Disney as America's Most Valuable Media Company

Netflix Ready to Surpass Disney as America's Most Valuable Media Company

Global Stocks Hold Gains as North Korea Response on Talks Soothes Nerves

Global Stocks Hold Gains as North Korea Response on Talks Soothes Nerves

Italian Bonds Slump as Government Mulls Anti-Euro Finance Minister

Italian Bonds Slump as Government Mulls Anti-Euro Finance Minister