Convex cocompact actions of relatively hyperbolic groups