The high-energy pulsed X-ray spectrum of Hercules X-1 as observed with OSO 8