Optimal Power Flow With State Estimation in the Loop for Distribution Networks