Production of hypernuclei in peripheral relativistic ion collisions