A characterization of local complete intersections in terms of the Ext-algebra