The MUSE Hubble Ultra Deep Field Survey. XV. The mean rest-UV spectra of Ly emitters at z > 3