Shadow of a black hole at cosmological distances