NEW YORK (TheStreet) -- Stocks held onto session highs late afternoon Friday after the eurozone announced it had reached an agreement on a four-month loan extension with Greece.

The S&P 500 was up 0.52%, the Dow Jones Industrial Average gained 0.76%, and the Nasdaq climbed 0.55%.

The extension would extend Greece's previous bailout agreement for another four months, according to Eurogroup Chairman Jeroen Dijsselbloem. 

Leaders have been in negotiation for a potential new debt package since last week. Earlier this week, Greece requested a six-month extension to its current loan but Germany rejected the request after Greece refused to adhere to previous austerity measures in place.

Benchmark indexes traded slightly lower earlier in the day, weighed down by uncertainty in the eurozone and poor earnings results from Deere (DE) and Noodles (NDLS) . Heavy machinery maker Deere was flat, recovering from earlier losses after it forecast a drop in sales on weaker demand in the global farm sector, particularly for agricultural machinery. Quarterly earnings of $1.12 a share slipped from $1.81 a share a year earlier.

Noodles plummeted more than 28% after missing analysts' estimates on its top- and bottom-lines. Comparable-restaurant sales increased 1.3% over the quarter.

The world's largest retailer, Wal-Mart  (WMT) , was up 1% following a 3% drop on Thursday on light guidance and a quarterly revenue miss. Shares appeared unaffected by ratings revisions from Barclays and Goldman Sachs. Analysts at both firms predicted investments in labor would hurt profits.

Nordstrom (JWN) was up 4.7% despite reporting fourth-quarter profit of $1.32 a share, 3 cents short of estimates.

Sysco (SYY) was gaining despite news the Federal Trade Commission had filed a suit to oppose the proposed $3.5 billion takeover of U.S. Foods. "This proposed merger would eliminate significant competition in the marketplace," said FTC director Debbit Feinstein of the Bureau of Competition in a statement. 

Business activity in the eurozone showed signs of increasing growth momentum. In February, the region's PMI rose to a seven-month high of 53.5, boosted by strength in Germany, its largest economy, and France. European markets were mixed with France's CAC 40 down, but Germany's DAX and the FTSE 100 in London posting modest gains.

West Texas Intermediate crude was down 1.2% to $50.54 a barrel, recovering from losses of over 1% earlier in the day. Oil services company Baker Hughes (BHI)  said U.S. oil rigs fell by 37 to 1,019 over the week, a 28.5% drop from a year earlier. A week earlier, the firm reported a decline in oil rigs to their lowest level since August 2011 last week.

However, oil prices remain at half their mid-summer high as a drop in U.S. rig counts and a number of oilers cutting future investments isn't seen as enough to remedy global oversupply and tepid demand. On Thursday, the Energy Information Administration reported a sixth straight weekly increase in U.S. crude inventories, which were already at record levels.

The Markit manufacturing purchasing managers' index increased to 54.3 from 53.9 in January, its highest reading since November. Though higher, the reading reinforces recent data showing slower growth in the U.S. economy, particularly in its industrial and manufacturing sectors.

--Written by Keris Alison Lahiff in New York.