Effects of impurities on radiation damage in InP