Socialist, centrist and conservative candidates have been struggling to gain ground ahead of France's presidential elections, amid a race dominated by the hard left and far-right.