Angular distribution of electrons ejected by charged particles: I. Ionization of He and H2 by protons