Most conspicuous organisms are multicellular and most multicellular organisms develop somatic cells to perform specific, nonreproductive tasks. The ubiquity of this division of labor suggests that it is highly advantageous. In this article I present a model to study the evolution of specialized cells. The model allows for unicellular and multicellular organisms that may contain somatic (terminally differentiated) cells. Cells contribute additively to a quantitative trait. The fitness of the organism depends on this quantitative trait (via a benefit function), the size of the organism, and the number of somatic cells. The model allows one to determine when somatic cells are advantageous and to calculate the optimum number (or fraction) of reproductive cells. I show that the fraction of reproductive cells is always surprisingly high. If somatic cells are very small, they can outnumber reproductive cells but their biomass is still less than the biomass of reproductive cells. I discuss the biology of primitive multicellular organisms with respect to the model predictions. I find a good agreement and outline how this work can be used to guide further quantitative studies of multicellularity.