Global formality for embeddings of varieties