Optimal Dividend Problem for a Compound Poisson Risk Model