Compared to a year earlier, the economy grew 4% in the last three months of 2021, official figures show.