The German economy contracted by 0.2% in 2024, in the second consecutive year of declines in the annual gross domestic product of Europe's largest economy.