Theory of the angular distribution of molecular photofragments