Counterparty credit risk under credit risk contagion using time-homogeneous phase-type distribution