On a class of optimal partition problems related to the Fucik spectrum and to the monotonicity formulae