– The stock market closed slightly higher on Thursday as gains for utilities and financial stocks were largely offset by losses in energy and materials companies.

Kroger jumped after reporting better-than-expected earnings that were boosted in part by lower fuel costs. Joy Global, a manufacturer of mining equipment, fell sharply after it said that the worldwide plunge in commodity prices was hurting its business.

Investors got some positive news on the global economy early in the day as the European Central Bank upgraded its growth forecast for the eurozone this year to 1.5 percent from 1 percent. ECB President Mario Draghi also said that the bank's planned 1 trillion euro ($1.1 trillion) stimulus program will start Monday.

Even though gains for stocks have slowed, major indexes remain close to record levels.

Stocks remain attractive because interest rates are still close to historic lows, while company earnings are inching higher, said Scott Keifer, a global investment specialist at JPMorgan Private Bank.

The Standard & Poor's 500 index rose 2.51 points, or 0.1 percent, to 2,101.04. The Dow Jones industrial average gained 38.82 points, or 0.2 percent, to 18,135.72. The Nasdaq composite climbed 15.67 points, or 0.3 percent, to 4,982.81.

On Thursday, health care stocks got a boost from some merger news. The sector was one of the hottest for acquisitions last year, and that trend that looks set to continue.

Pharmacyclics jumped after AbbVie said it would acquire the company for about $21 billion. Pharmacyclics rose $23.74, or 10.3 percent, to $254.22, while AbbVie's stock fell $3.41, or 5.7 percent, to $56.86.