An analytical model for the history of cosmic star formation