Spectral synthesis in the ultraviolet. II - Stellar populations and star formation in blue compact galaxies