A slowdown in the transition to electric vehicles contributed to a fall in UK car production last year, new figures show.