The bar complex of an E-infinity algebra