Spectral line survey of the ultracompact HII region Monoceros R2