The UK economy contracted by 0.2% between April and June, its worst performance for more than six years.