Retail sales fell 0.5% in May as households cut spending in supermarkets due to the rising cost of living.