Take into account that potential difference is defined as the quotient between the energy requierd to move a charge a from a point A to a point B. Use the following formula:
where ΔV is the potential difference, ΔU is the energy and q is the charge.
In this case, ΔU = 10J and q = 2C. By replacing these values into the previous formula and by simplifying you obtain:
where 1J/C = 1V (for the units of potential difference)
Hence, the potential difference is 5V