Analytical model for the evolution of giant extrasolar planets