A new class of generalized contraction using P-functions in ordered metric spaces