Let A be a connected graded algebra and let E denote its Ext-algebra. There is a natural A-infinity algebra structure on E, and we prove that this structure is mainly determined by the relations of A. In particular, the coefficients of the A-infinity products m_n restricted to the tensor powers of Ext^1 give the coefficients of the relations of A. We also relate the m_ns to Massey products.