All disc-accreting astrophysical objects also produce powerful disc winds and/or jets. In compact binaries containing neutron stars or black holes, accretion often takes place during violent outbursts. The main disc wind signatures seen during these eruptions are blue-shifted X-ray absorption lines. However, these signatures are only observed during "soft states", when the accretion disc generates most of the luminosity. By contrast, optical wind-formed absorption lines have recently been detected in "hard states", when the luminosity is dominated by a hot corona. The relationship between these disc wind signatures is unknown, and no erupting compact binary has so far been observed to display wind-formed lines between the X-ray and optical bands, despite the many strong resonance transitions in this ultraviolet (UV) region of the spectrum. In turn, the impact of disc winds on the overall mass and energy budget of these systems remains a key open question. Here, we show that the transient neutron star X-ray binary Swift J1858.6-0814 exhibits wind-formed, blue-shifted absorption features associated with C IV, N V and He II in time-resolved, UV spectroscopy obtained with the Cosmic Origins Spectrograph on board the Hubble Space Telescope during a luminous hard state. In simultaneous ground-based observations, the optical H and He I lines also display transient blue-shifted absorption troughs. By decomposing our UV data into constant and flaring components, we demonstrate that the blue-shifted absorption is associated with the former, which implies that the outflow is always present. The joint presence of UV and optical wind features in the hard state reveals a multi-phase and/or spatially stratified evaporative outflow from the outer disc. This type of persistent mass loss across all accretion states has been predicted by radiation-hydrodynamic simulations and is required to account for the shorter-than-expected outburst durations.