Cosmology with massive neutrinos I: towards a realistic modeling of the relation between matter, haloes and galaxies