The ionization fraction in dense clouds