First-principles calculations of steady-state voltage-controlled magnetism: Application to x-ray absorption spectroscopy experiments