On a semilinear variational problem