Gyrokinetic determination of the electrostatic potential of rotating magnetic islands in tokamaks