In the Universe, matter outside of stars and compact objects is mostly composed of collisionless plasma. The interaction of a supersonic plasma flow with an obstacle results in collisionless shocks that are often associated with intense nonthermal radiation and the production of cosmic ray particles. Motivated by simulations of non-relativistic high-Mach-number shocks in supernova remnants, we investigate the instabilities excited by relativistic electron beams in the extended foreshock of oblique shocks. The phase-space distributions in the inner and outer foreshock regions are derived with a particle-in-cell simulation of the shock and used as initial conditions for simulations with periodic boundary conditions to study their relaxation toward equilibrium. We find that the observed electron-beam instabilities agree very well with the predictions of a linear dispersion analysis: the electrostatic electron-acoustic instability dominates in the outer region of the foreshock, while the denser electron beams in the inner foreshock drive the gyroresonant oblique-whistler instability.