A lattice gas model for microemulsions