Automakers had their worst year of UK sales in three decades, with only electric vehicles providing a bright spot.