Americans signed more contracts to buy previously occupied homes in May, matching the fastest pace in two years. The increase suggests consumers are gaining confidence in the housing market and a modest recovery will continue.

The National Association of Realtors said Wednesday that its index of sales agreements increased to 101.1 last month from 95.5 in April. That matches March's reading, the highest since April 2010, when a home-buying tax credit boosted sales.

A reading of 100 is considered healthy. The index is 13.3 percent higher than it was a year ago. It bottomed at 75.88 in June 2010, after the tax credit expired.

The increase supports other data showing steady improvement in the housing market this year, even as hiring slumps and consumer confidence sags.

Sales of new and previously occupied homes are up over the 12 months. Builders are starting more projects. And prices are rising in most markets.

"Despite the gloom in much of the recent economic data, housing continues to show real signs of life," said Ian Shepherdson, chief U.S. economist at High Frequency Economics.

The economy benefits when home sales rise. Buyers typically spend more on renovations, furniture, appliances and landscaping.

There's also a psychological factor. In good times, most homes rise in value. When homes appreciate, people feel they have more money. So they spend more. Consumer spending drives roughly 70 percent of economic activity.

It typically takes one to two months for buyers to close on a home after signing a contract. So the increase in signed contracts suggests completed home sales will rise this summer. That could drive prices higher and encourage more people to put homes on the market.

Home prices increased in 19 of 20 major U.S. cities in April from March, according to the Standard & Poor's/Case-Shiller index, released Tuesday. A measure of national prices rose 1.3 percent in April, the first increase in seven months.

Still, sales remain far below healthy levels. Analysts say it could be years before the housing market returns to full health.

One reason prices are rising is the supply of homes for sale remains extremely low. The inventory of previously occupied homes for sale is back down to levels last seen in 2006. And there were 145,000 new homes for sale in May, just 1,000 higher than in April, which was the lowest supply on records dating back to 1963.

The Realtors group cautioned that sales could slow if more people don't list their homes.

The limited inventory should spur more home building, the Realtors group said. If housing starts don't increase, the limited supply could drive up prices.

In May, contract signings increased in all regions. The largest rise was in the West, where the index jumped 14.5 percent in May. Signings rose 6.3 percent in the Midwest, 4.8 percent in the Northeast, and 1.1 percent in the South.

Despite the modest gains in housing, the broader economy has weakened in recent months. Employers have added an average of only 73,000 jobs a month in April and May. That's much lower than the average of 226,000 added in the first three months of this year.