Determining central black hole masses in distant active galaxies