A weighted extremal function and equilibrium measure