A variational problem related to conformal maps