A model for planetary igneous differentiation