The extension problem for compact submanifolds of complex manifolds, I. The case of a trivial normal bundle