Short answer: you don't want to consider group cohomology as defined for finite groups for Lie groups like $U(1)$, or indeed topological groups in general. There are other cohomology theories (not Stasheff's) that are the 'right' cohomology groups, in that there are the right isomorphisms in low dimensions with various other things.
Long answer:
Group cohology, as one comes across it in e.g. Ken Brown's book (or see these notes), is all about discrete groups. The definition of group cocycles in $H^n(G,A)$, for $A$ and abelian group, can be seen to be the same as maps of simplicial sets $N\mathbf{B}G \to \mathbf{K}(A,n)$, where $\mathbf{B}G$ is the groupoid with one object and arrow set $G$, $N$ denotes its nerve and $\mathbf{K}(A,n)$ is the simplicial set corresponding (under the Dold-Kan correspondence) to the chain complex $\ldots \to 1 \to A \to 1 \to \ldots$, where $A$ is in position $n$, and all other groups are trivial. Coboundaries between cocycles are just homotopies between maps of simplicial spaces.
The relation between $N\mathbf{B}G$ and $K(G,1)$ is that the latter is the geometric realisation of the former, and the geometric realisation of $\mathbf{K}(A,n)$ is an Eilenberg-MacLane space $K(A,n)$, which represents ordinary cohomology ($H^n(X,A) \simeq [X,K(A,n)]$, where $[-,-]$ denotes homotopy classes of maps). This boils down to the fact that simplicial sets and topological spaces encode the same homotopical information. It helps that $N\mathbf{B}G$ is a Kan complex, and so the naive homotopy classes are the right homotopy classes, and so we have
$$sSet(N\mathbf{B}G,\mathbf{K}(A,n))/homotopy \simeq Top(BG,K(A,n))/homotopy = [BG,K(A,n)]$$
In fact this isomorphism is a homotopy equivalence of the full hom-spaces, not just up to homotopy.
If we write down the same definition of cocycles with a topological group $G$, then this gives the 'wrong' cohomology. In particular, we should have the interpretation of $H^2(G,A)$ as isomorphic to the set of (equivalence classes of) extensions of $G$ by $A$, as for discrete groups. However, we only get semi-direct products of topological groups this way, whereas there are extensions of topological groups which are not semi-direct products - they are non-trivial principal bundles as well as being group extensions. Consider for example $\mathbb{Z}/2 \to SU(2) \to SO(3)$.
The reason for this is that when dealing with maps between simplicial spaces, as $N\mathbf{B}G$ and $\mathbf{K}(A,n)$ become when dealing with topological groups, it is not enough to just consider maps of simplicial spaces; one must localise the category of simplicial spaces, that is add formal inverses of certain maps. This is because ordinary maps of simplicial spaces are not enough to calculate the space of maps as before. We still have $BG$ as the geometric realisation of the nerve of $\mathbf{B}G$, and so one definition of the cohomology of the topological group $G$ with values in the discrete group $A$ is to consider the ordinary cohomology $H^n(BG,A) = [BG,K(A,n)]$.
However, if $A$ is also a non-discrete topological group, this is not really enough, because to define cohomology of a space with values in a non-discrete group, you should be looking at sheaf cohomology, where the values are taken in the sheaf of groups associated to $A$. For discrete groups $A$ this gives the same result as cohomology defined in the 'usual way' (say by using Eilenberg-MacLane spaces).
So the story is a little more complicated than you supposed. The 'proper ' way to define cohomology for topological groups, with values in an abelian topological group (at least with some mild niceness assumptions on our groups) was given by Segal in
G Segal, Cohomology of topological groups, in: "Symposia Mathematica, Vol. IV (INDAM, Rome, 1968/69)", Academic Press (1970) 377–387
and later rediscovered by Brylinski (it is difficult to find a copy of Segal's article) in the context of Lie groups in this article.
Best Answer
Consider ordinary singular cohomology with varying coefficients. You can look at the short exact sequence of abelian groups:
$$0 \to \mathbb{Z}/2 \to \mathbb{Z}/4 \to \mathbb{Z}/2 \to 0$$
This gives rise, for any space X, to a short exact sequence of chain complexes:
$$0 \to C^i(X;\mathbb{Z}/2) \to C^i(X;\mathbb{Z}/4) \to C^i(X;\mathbb{Z}/2) \to 0$$
and hence you get a long exact sequence in cohomology. Thus we get an interesting boundary map known as the Bockstein
$$H^i(X; \mathbb{Z}/2) \to H^{i+1}(X; \mathbb{Z}/2).$$
This is natural in X and so is represented by a (homotopy class of) map(s) of Eilenberg-Maclane spaces:
$$K(i, \mathbb{Z}/2) \to K(i+1, \mathbb{Z}/2)$$
This map is necessarily zero on homotopy groups. To show that this map is not null-homotopy, you just need to find a space for which the Bockstein is non-trivial. There are lots of examples of this. Rather then explain one, I suggest you look up "Bockstein homomorphism" in a standard algebraic topology reference, e.g. Hatcher's book.