Infrared spectroscopy of molecular ions in a magnetically confined glow discharge