Both services and manufacturing saw a fall in the second quarter of the year, official figures show.