The irreducible components of the moduli space of dihedral covers of algebraic curves