Euclid preparation XL. Impact of magnification on spectroscopic galaxy clustering