Solid earnings from big U.S. companies such as Ford, 3M Co and United Parcel Service lifted stocks on Tuesday, but investors braced for a report on consumer confidence amid concerns about the recent rise in oil prices.

Corporate earnings have been generally strong so far this season, with around three-quarters of S&P 500 companies beating analysts' forecasts so far. That has helped push the Dow industrials up to near three-year highs.

U.S. consumer confidence data for April, to be released later on Tuesday, will be closely watched against a backdrop of rising oil prices and stubbornly high unemployment, which investors fear could hurt consumer spending.

With gasoline prices continuing to climb, at some point it's definitely going to affect the mind of the consumer, said Peter Cardillo, chief market economist at Avalon Partners in New York. Have we reached there yet? I'm not too sure.

The Dow Jones industrial average <.DJI> rose 23.54 points, or 0.19 percent, at 12,503.42. The Standard & Poor's 500 Index <.SPX> climbed 4.38 points, or 0.33 percent, at 1,339.63. The Nasdaq Composite Index <.IXIC> added 5.59 points, or 0.20 percent, at 2,831.47.

United Parcel Service , an economic bellwether that handles a large chunk of the world's business deliveries, said the global economic outlook was a little cloudier than 3 months ago, but at the same time it said it sees record earnings in 2011. The shares rose 1.5 percent to $74.52.

On balance we have seen good earnings come through and today is no exception, said Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia. We continue to see good news coming out of industrial America.

Ford Motor Co reported its best first-quarter profit in 13 years, driven by strong sales in its home market and demand for more fuel-efficient vehicles, sending its shares up 3.1 percent to $16.03.

Industrial and consumer goods conglomerate 3M reported higher-than-expected quarterly profit, helped by sales to emerging markets, and raised its full-year profit forecast. The company's shares rose 0.8 percent to $94.84.

(Editing by Kenneth Barry)