Stocks posted slight gains on Friday as a rebound in crude prices fueled a rally in the energy sector.

The S&P 500 was up 0.27%, and the Nasdaq added 0.24%. The Dow Jones Industrial Average gained 0.13%. 

Crude oil held gains on Friday, a day after settling at its lowest level since Nov. 29. The crude selloff was largely tied to concerns over global oversupply. Those concerns remained in the background on Friday, though, after oil and natural gas producers in the U.S. rose over the past week. The number of active rigs in the U.S. drilling for crude rose by seven in the past week, bringing the total rig count up to a total of 877 units, according to Baker Hughes. Production has risen for 12 weeks in a row.

Risks to Libyan production eased on Thursday, threatening to destabilize the slow progress toward a global supply balance. Two of the largest factions in Libya have made progress toward a deal to resolve political unrest and economic conflicts, according to the BBC. Recent conflicts had caused shutdowns at several of Libya's largest oilfields.

West Texas Intermediate crude closed 1.5% higher at $46.22 a barrel on Friday.

Oil saw unusual trading patterns overnight, falling by more than $1 a barrel at one point. Jim Cramer assesses how significant the moves could be over on Real Money. Get a free trial subscription to Action Alerts PLUS.

The energy sector was among the best performers on Friday afternoon. Major oil producers including Exxon Mobil (XOM) , Royal Dutch Shell (RDS.A) , Chevron (CVX) , Total (TOT) , and BP (BP) rose on Friday, while the Energy Select Sector SPDR ETF (XLE) added 1.1%. 

A solid April jobs report shored up the chances of a move on interest rates from the Federal Reserve next month. The U.S. nonfarm payrolls report showed more jobs added to the U.S. economy in April than economists expected and the unemployment rate fell to its lowest level in a decade.

The U.S. economy added 211,000 new jobs in April, according to the Labor Department's nonfarm payrolls report.Around 185,000 jobs are expected to have been added to the U.S. economy in April, according to economists polled by FactSet. The unemployment rate unexpectedly fell to 4.4% from 4.5%, rather than an anticipated increase to 4.6%. Average hourly wages rose 0.3%, as expected. The March jobs gain was reduced to 79,000 from 98,000, while the February gain was increased to 232,000 from 219,000. 

"Today's jobs report continues the long-term trend of U.S. economic recovery and shows that last month's number was an anomaly," said Tony Bedikian, head of global markets at Citizens Bank. "The unemployment rate hit another new low and wages continue to improve."

The strong April jobs report is something of an outlier with pockets of economic weakness seen elsewhere in recent months. James "Rev Shark" Deporre teases out the issue over on our premium site Real Money.

The better-than-expected April report raised the prospects of an interest rate hike in June from the Federal Reserve. The chances of an increase in the federal funds rate to 1% to 1.25% at the June meeting increased to 79%, according to CME Group fed funds futures. Chances sat at 74% by the end of the day Thursday.

"This is another firm step towards a hike in June," said Luke Bartholomew, Aberdeen Asset Management investment strategist. "There's not much now to suggest we are anything but very close to full employment."

If you liked this article you might like

Healthcare Management Stocks Look Too Pricey for Activists

The Stock That Crashed 25% Overnight Has a Lesson to Teach Us: Market Recon