Dimitar Berbatov scored his first goal for Monaco, an extra-time winner against Nice, to send the Ligue 1 club into the last eight of the French Cup.