The economy shrank by 10.1% in the April-to-June period, official figures show.