Operator algebras for analytic varieties