Dark matter in spiral galaxies. I. Galaxies with optical rotation curves