Four-dimensional string compactifications with D-branes, orientifolds and fluxes