In his experiments with gravity, Isaac Newton showed how the motion of each planet in the solar system results from the combined gravitational pull of the Sun and
of all the other planets, each contributing according to their mass and distance from the others.
(A) of all the other planets, each contributing according to their -> each requires singular pronoun. So, "their" is incorrect.
(B) of all the other planets, with each of them contributing according to their -> Same as A. Incorrect.
(C) all the other planets, each of which contributing according to its -> which indicates for a clause to follow. And, a clause must have a verb. But, we don't have a verb post "which". Incorrect.
(D) all the other planets, each contributing according to its -> This is better. Let's keep it.
(E) all the other planets, each of which contribute according to their -> Same as A. Incorrect.
So, I think D.