The sharp contraction in gross domestic product reflects the swift impact of the coronavirus pandemic on the US economy.