Computing the luminosity distance via optimal homotopy perturbation method