The distance-resolved effective interaction potential between two parallel DNA molecules is calculated by computer simulations with explicit tetravalent counterions and monovalent salt. Adding counterions first yields an attractive minimum in the potential at short distances which then disappears in favor of a shallower minimum at larger separations. The resulting phase diagram includes a DNA-condensation and redissolution transition and a stable mesocrystal with an intermediate lattice constant for high counterion concentration.