Biogas purification and liquefaction by means of a cryogenic upgrading process