Relatively projective pro-$p$ groups