Lie coalgebras and rational homotopy theory II: Hopf invariants