* Euro-zone officials agree to prep for Greek exit scenario * Dell revenue outlook weighs on sentiment * Facebook shares rebound despite lawsuit * Dow off 0.1 pct, S&P up 0.2 pct, Nasdaq gained 0.4 pct By Edward Krudy NEW YORK, May 23 (Reuters) - U.S. stocks staged a late-day reversal on Wednesday, rallying into the close in another volatile session as a sharp rise in materials shares boosted the S&P 500 and gains in Apple helped lift the Nasdaq. The action shortly before the market's close was a mirror image of Tuesday when stocks gave up gains in the last minutes of trading. The late rebound suggested investors saw value in the market after the S&P 500 fell just below 1,300 but also underscored the skittishness of the trading environment. One trader warned not to read too much into the move that lifted the indexes near breakeven for the day. "I don't make anything of this. Volumes are very low, so there's no conviction," said Todd Schoenberger, managing principal at the BlackBay Group in New York. "We're only hearing what we want to hear. Don't be surprised if futures are disappointed tomorrow." Towards the close traders cited rumors that the European Union was considering a proposal to guarantee bank deposits across the bloc. Such a move could assuage fears of bank runs in Spain and Greece. The rumors, which one trader said may have originated in London, appeared to be unfounded and served to highlight the markets' current sensitivity to events in Europe. Shares in beaten-down materials companies led the S&P 500, with the S&P's materials sector gaining 1.1 percent. Alpha Natural Resources rose 5 percent to $11.70. Boosting the Nasdaq were shares of Apple, up 2.4 percent to $570.56. In the overall market, the Dow Jones industrial average dipped 6.66 points, or 0.05 percent, to 12,496.15. The S&P 500 Index edged up 2.23 points, or 0.17 percent, to 1,318.86. The Nasdaq Composite gained 11.04 points, or 0.39 percent, to 2,850.12. For most of the day shares fell by more than 1 percent as EU officials said euro zone countries must prepare contingency plans for a possible Greek exit of the currency bloc, while a weak outlook from Dell Inc cast doubts about the strength of global tech spending. Volume on the NYSE, Nasdaq and Amex was above average. Around 7.52 billion shares traded compared with a year-to-date average of 6.84 billion. About three stocks rose for every two that fell on the NYSE. Shares in Dell Inc tumbled more than 18 percent and hit other tech stocks as the revenue forecast from the third-largest computer maker spurred fears that global tech spending was declining faster than thought. Dell plunged 17.2 percent to $12.49, its biggest one-day drop in more than a decade. Hewlett-Packard slid more than 3 percent during the regular session. But shares of the tech company jumped 10 percent in extended trading after it released financial results. HP outlined a multi-year plan including job cuts of 27,000 employees, or about 8 percent of its workforce, to spur growth. The agreement by euro-zone officials on contingency planning for a Greek exit of the euro zone, or "Grexit" as some investors are now calling it, came during a teleconference of the Eurogroup Working Group on Monday, sources told Reuters. Eric Kuby, chief investment officer at North Star Investment Management in Chicago, said renewed concerns about Greece, troubling outlooks from Dell and others, worries about the economy, Facebook's disappointing IPO and JPMorgan's recent trading loss were adding up to significant headwinds. "It has made people less likely to jump in there and buy stocks," he said. "A lack of good news, some bad news and these worries that have been around for a long time make it hard to get a rally going." The S&P 500 is down 7 percent from a peak in April but is up 4.9 percent for the year so far. Some analysts are expecting the index to test its 200-day moving average at around 1,280, another 2 percent below current levels. Facebook Inc and banks, including Morgan Stanley , were sued by the social networking leader's shareholders, who claimed the defendants hid Facebook's weakened growth forecasts ahead of its $16 billion initial public offering. The stock was up 3.2 percent at $32 after falling more than 30 percent from it peak on Friday. Falling oil prices also depressed the energy sector, with an S&P index of energy companies edging up 0.4 percent into the close. U.S. July crude oil future fell $2.30 to a session low of $89.55, trading below $90 a barrel for the first time since Nov. 1, on easing concerns about Iran's nuclear dispute with the West and increasing worries about global economic growth.