Melanin is a pigment in the skin of animals (including humans). Melanin is essentially what allows the human body (the skin) to darken when sunlight (or, ultraviolet rays) hits it. The skin absorbs the UV rays and the melanin allows the skin to become darker.
A simpler definition:
Any of a group of naturally occurring dark pigments, especially the pigment found in skin, hair, fur, and feathers.