The main goal of this work is to compare the effects induced in ices of astrophysical relevance by high-energy ions, simulating cosmic rays, and by vacuum ultraviolet (UV) photons. This comparison relies on in situ infrared spectroscopy of irradiated CH3OH:NH3 ice. Swift heavy ions were provided by the GANIL accelerator. The source of UV was a microwave-stimulated hydrogen flow discharge lamp. The deposited energy doses were similar for ion beams and UV photons to allow a direct comparison. A variety of organic species was detected during irradiation and later during ice warm-up. These products are common to ion and UV irradiation for doses up to a few tens of eV per molecule. Only the relative abundance of the CO product, after ice irradiation, was clearly higher in the ion irradiation experiments. For some ice mixture compositions, the irradiation products formed depend only weakly on the type of irradiation, swift heavy ions, or UV photons. This simplifies the chemical modeling of energetic ice processing in space.