The UK officially entered a recession, with the economy shrinking by 1.2% in the second quarter.