The emission spectrum of H2 from associative detachment and ultraviolet pumping