We describe the spin distribution in the vicinity of a nonmagnetic impurity in a two-dimensional antiferromagnet undergoing a transition from a magnetically ordered Neel state to a paramagnet with a spin gap. The quantum critical ground state in a finite system has total spin S=1/2 (if the system without the impurity had an even number of S=1/2 spins), and recent numerical studies in a double layer antiferromagnet [K. H. Hoglund , Phys. Rev. Lett. 98, 087203 (2007)] have shown that the spin has a universal spatial form delocalized across the entire sample. We present the field theory describing the uniform and staggered magnetizations in this spin texture for two classes of antiferromagnets: (i) the transition from a Neel state to a paramagnet with local spin singlets, in models with an even number of S=1/2 spins per unit cell, which are described by a O(3) Landau-Ginzburg-Wilson field theory; and (ii) the transition from a Neel state to a valence bond solid, in antiferromagnets with a single S=1/2 spin per unit cell, which are described by a "deconfined" field theory of spinons.