The Verlinde formula in logarithmic CFT