The number of job openings climbed in December to 6.6 million, up from 6.5 million in November. Economists had forecast a decline to 6.4 million jobs.

The figures come from the Labor Department’s monthly Job Openings and Labor Turnover Survey, known as JOLTS, released Tuesday.

The better than expected news on openings contrasts with other data that showed a bleak end of the year in the labor market. The monthly employment situation report, also from the Labor Department, showed that total employment shrank by 227,000 in December.

The contrast suggests that the pandemic may be making it difficult for employers to find workers to fill open jobs. In December, the number of hires fell a seasonally adjusted 396,000 to 5.5 million even though employers were looking for more workers. Most of that decline came in the private sector, where hires fell by a seasonally adjusted 384,000.

Some industries held up better than others in December. Hires in construction rose and held steady in manufacturing, while job openings contracted somewhat in both sectors.

Retail trade hiring accelerated from 724,000 in November to 818,000 in December, in seasonally adjusted figures. That is above the pre-pandemic year-ago level of 772,000.

There was a sharp decline in leisure and hospitality. Hires fell from 1.079 million in November to 777,000 in December. A year earlier, there were 1,165 hires in the sector. Openings also plunged, falling from 888,000 in November to 761,000, well-below the year-earlier figure of 916,000. Most of the declines were seen in hotels, restaurants, and bars.

Layoffs were extremely elevated in leisure and hospitality, up to 513,000 in December compared with 479,000 in November. In December of 2019, there were 342,000 layoffs in the sector.