An algebraic approach to logarithmic conformal field theory