An overdetermined problem with non-constant boundary condition