FAST-PT: a novel algorithm to calculate convolution integrals in cosmological perturbation theory