A $C^m$ Whitney extension theorem for horizontal curves in the Heisenberg group