Dynamically-Consistent Trajectory Optimization for Legged Robots via Contact Point Decomposition