Ricci solitons on compact three-manifolds