U.S. stocks closed higher Thursday following two straight sessions of losses as market-watchers look ahead to Friday’s highly anticipated jobs report. The data could affect the timing of the U.S. Federal Reserve's next interest rate hike, which most economists expect to happen sometime after midyear.

The Dow Jones Industrial Average, which measures the share prices of 30 large industrial companies, gained 38.82 points, or 0.21 percent, to close at 18,135.72. The S&P 500 stock index added 2.51 points, or 0.12 percent, to end at 2,101.04. The Nasdaq composite index rose 16.615.67 points, or 0.32 percent, to finish at 4,982.81.

Economists are looking to the U.S. nonfarm payrolls report for February, due out Friday. The report is expected to show U.S. employers added 240,000 jobs in February, down from 257,000 in January, according to analysts polled by Thomson Reuters. The unemployment rate is expected to tick down to 5.6 percent last month after rising to 5.7 percent in January. Average hourly earnings are forecast to increase 0.2 percent and hours worked is expected to hold steady at 34.6 per week.

The U.S. economy added 3.1 million jobs in 2014, the most since 1999, while the nonfarm payrolls posted 12 consecutive readings above 200,000. The last time this happened was 20 years ago. "As the labor market continues to make significant progress, pent-up downward wage rigidity should decline and wage growth should accelerate," Gregory Daco, head of U.S. macroeconomics at Oxford Economics, said in a research note Monday. 

U.S. stocks got a boost in early trading after the European Central Bank upgraded the eurozone’s growth forecasts and announced it will begin its massive $1 trillion monetary stimulus program on March 9.

U.S. oil prices closed lower Thursday, but still traded above $50 per barrel. West Texas Intermediate crude, the benchmark for U.S. oil prices, fell 1.5 percent to $50.76 a barrel, for April 15 delivery on the New York Mercantile Exchange. Brent crude, the benchmark for global oil prices, closed flat at $60.60 a barrel, for April 15 delivery on the London ICE Futures Exchange.