Melanin is a ubiquitous pigment in living organisms with multiple important functions, yet its structure is not well understood. We propose a structural model for eumelanin protomolecules, consisting of 4 or 5 of the basic molecular units (hydroquinone, indolequinone, and its tautomers), in arrangements that contain an inner porphyrin ring. We use time-dependent density functional theory to calculate the optical absorption spectrum of the structural model, which reproduces convincingly the main features of the experimental spectrum of eumelanin. Our model also reproduces accurately other important properties of eumelanin, including x-ray scattering data, its ability to capture and release metal ions, and the characteristic size of the protomolecules.