NEW YORK (TheStreet) -- U.S. stocks recovered gains mid-afternoon Friday as a rally among energy companies pulled benchmark indexes higher. Markets had seen a brief blip earlier after utilities sold off and weighed on broader equities.

The S&P 500 was up 0.26%, the Nasdaq gained 0.55%, and the Dow Jones Industrial Average added 0.23%.

STOCKS TO BUY: TheStreet Quant Ratings has identified a handful of stocks that can potentially TRIPLE in the next 12 months. Learn more.

Crude oil was gaining for a second day on Friday as investors bet on a bottom after six months of plummeting prices. West Texas Intermediate crude added 2.7% to $52.61 a barrel, though remained at more than half a mid-summer peak.

Miners BHP Billiton (BHP) , Rio Tinto (RIO) , and Freeport-McMoRan (FCX) were all higher, while oil companies Valero Energy (VLO) and Marathon Petroleum (MPC) bounced. The Energy Select Sector SPDR ETF (XLE) jumped 1.9%.

Utilities stocks were lower, dragged down by Exelon (EXC) which missed earnings estimates because of unfavorable weather over its fourth quarter. Others in the sectors were lower including Southern (SO) , Duke Energy (DUK) and Dominion Resources (D) . The Utilities SPDR ETF (XLU) dropped 2.1%.

European shares rallied after Germany showed signs of a strong rebound. Europe's largest economy reported a 0.7% increase in GDP over the fourth quarter, adding to a 0.1% increase in the previous three months.

"We look for stronger growth going forward as the effects of quantitative easing take hold, but downside risks still remain," said Wells Fargo analysts in a note. "Among these downside risks is the potential for a "Grexit" ... While we do not see this as imminent, it is a potential outcome that would have negative effects on the Eurozone economy."

Hopes that a deal on Greece's debt would be sealed by Monday were boosted after a Greek government spokesperson said Greece would do "whatever they can so that a deal is found." Greek Finance Minister Yanis Varoufakis has been meeting with eurozone leaders in Brussels to negotiate new terms of a bailout package. The European Central Bank also eased Greece's situation, extending another 5 billion euros to emergency loans to repay debt in case of default.

Leading the S&P 500, clothing retailer VF Corp (VFC) jumped 6% after meeting fourth-quarter earnings estimates and posting a 9% increase in sales. On a constant currency basis, revenue increased 11%, led by a 13% gain in its outdoor and action sports segment. 

King Digital (KING) surged 13% after beating fourth-quarter estimates on its top- and bottom-line. The company also announced its acquisition of Z2Live, developer of mobile games including Battle Nations, for $45 million in cash.

Groupon (GRPN) was higher, despite forecasting for a first quarter below expectations based on the impact of foreign exchange headwinds. The deals site expects revenue as much as $840 million, lower than estimates for $855.5 million.

Media network CBS (CBS) reported record revenue of $3.68 billion in its fourth quarter, due to 4% ad revenue gains thanks to Thursday Night Football and mid-term political ads. Shares added 3.2%.

American International Group (AIG) shook off disappointing earnings on Friday, climbing more than 2%. The insurer reported adjusted earnings of 97 cents a share, missing estimates by 8 cents.

Weighing on the Dow, American Express (AXP) continued to decline on Friday after Costco (COST) said it would stop accepting AmEx cards in April next year after the companies failed to renew a contract. Since the announcement was made Thursday, shares have tanked nearly 10%.

Zynga (ZNGA) plummeted 15.6% following first-quarter guidance for a loss of 2 cents to 3 cents a share. Analysts had expected the mobile app developer to post break-even earnings.

ConAgra (CAG) slipped 4.6% after lowering profit guidance to between $2.13 and $2.28 a share for the full year due to the strong U.S. dollar. Analysts expected full-year earnings of $2.26.

Freescale Semiconductor (FSL) jumped 7.4% on reports the chipmaker has hired investment bankers for a possible sale, according to The New York Post.

Consumer sentiment in February slid from an 11-year high to 93.6, according to the Reuters-University of Michigan survey. Economists had expected an unchanged reading of 98.1. According to the survey, consumers were feeling less uncertain about the labor market after layoffs in the energy sector and showed unwillingness to spend on big purchases.

"At face value, a fall in confidence could be a worrying sign following the weakness in underlying retail sales in both December and January," said Capital Economics assistant economist Andrew Hunter. "[But] the decline merely reversed the gain in January and, other than that reading last month, confidence is the highest it has been for seven years."

U.S. import prices fell at a slower-than-expected pace in January, down 2.8% month over month. Economists had expected a decline of 3.2%. Export prices also fell, down 2% compared to a forecast for a 0.9% decrease.

STOCKS TO BUY: TheStreet Quant Ratings has identified a handful of stocks that can potentially TRIPLE in the next 12 months. Learn more.

--Written by Keris Alison Lahiff in New York.