A surge of car buying in August contributed to a 1.7 per cent gain in overall retail sales by the nation's retail businesses, the Commerce Department reported yesterday.

It was the second consecutive monthly gain in sales, following three months of decline. Total retail sales in August were estimated at $59.92 billion, up from $58.92 billion in July.

The figures were adjusted for seasonal variations, but not for price changes.

The increase in consumer buying for the second month in a row is a good sign for the economy, especially because the three month decline earlier in the year had led to widespread fears that consumers were losing confidence in the economy.

The 1.7 per cent jump in retail sales in August was due chiefly to a 4 per cent rise in sales by auto dealers to $12.04 billion in August from $11.52 billion in July.

Excluding auto sales in August: overall retail sales rose by slightly less than 1 per cent. Total sales in durable goods scores rose by 4 per cent; and sales in nondurable goods stores were up 1 per cent.

In addition to the gains in autos, there also were increases for apparel and accessory stores, up 2 per cent to $2.47 billion, and furniture, home furnishings and equipment stores, also up 2 per cent, to $2.76 billion.

Retail sales in August were 10 per cent higher than in August of 1976, the Commerce Department said.