Metallicities of the β Cephei stars from low-resolution ultraviolet spectra