WASHINGTON—The number of U.S. existing homes going under contract declined in August for the fourth time in five months, reflecting what appears to be a broader slowdown in the housing market.

The National Association of Realtors on Thursday said its pending home-sales index, which tracks contract signings for purchases of previously owned homes, fell 1.8% from the prior month to 104.2 in August. Sales, unless they fall through, typically close within a month or two of signing.

Economists surveyed by The Wall Street Journal had expected a 0.4% decline in August.