Your question is based in a wrong assumption: that the epidermis should be white or that a white epidermis would reflect electromagnetic radiation and, therefore, protect the DNA against the ionizing portion of that radiation.
Before anything else: human epidermis without pigments (like melanin) has no color, that is, it's transparent. The white color we see in people with low melanin concentration is mostly due to the collagen in the underlying connective tissue1.
So, we have two possibilities:
- A transparent epidermis, which allows ionizing radiation reaching the living layers of epidermis (stratum granulosum and below, see the image) and dermis;
- An epidermis with a pigment that somehow "blocks" (absorbing or reflecting) the ionizing radiation.
Of course, it's not a good idea allowing all that ionizing radiation getting to the DNA, and because of that possibility #2 was the selected one. Therefore, there is production/accumulation of a pigment in the epidermis.
But which one, a white one or a black one?
Two important pieces of information may help you to understand this point.
First, the white pigment assumption doesn't mean the pigment need to be white: the pigment only have to reflect the ionizing (UV) section of the spectrum. It could be of any color, even almost black. Actually, melanin does reflects some UV radiation2.
Second, and the most important: if a given pigment just reflects the radiation, this radiation can still go to other nuclei and reach DNA, just like the scattered blue light in the sky goes everywhere, up and down. It's way more logical (I'm not implying that evolution operates logically, I'm just addressing your question) having an pigment that absorbs the ionizing radiation, which is the case of melanin.
By absorbing ionizing radiation, melanin (partially) avoids this ionizing radiation reaching the DNA.
Skin: A Natural History; Nina G. Jablonski, ISBN: 9780520275898, February 2013
Brenner M, Hearing VJ. The Protective Role of Melanin Against UV Damage in Human Skin. Photochemistry and photobiology. 2008;84(3):539-549. doi:10.1111/j.1751-1097.2007.00226.x.