Realization of the Dicke model using cavity-assisted Raman transitions