Nerd has two connotations, neither of which is very flattering.
The first was coined in the mid-60s and describes a stereotypical intelligent social recluse, one who usually is the butt of others' jokes. The nerd image contains thick black glasses, preferably broken and taped up with electrical tape, pocket protectors and wearing dress shirts or clothes that are in general too formal for the circumstances in which they are worn. Nerds express an above-normal interest in computers, technology in general, and academic subjects.
The second has been co-opted by computing jargon. A nerd is a lesser geek. Whereas geeks view themselves as technically competent and socially able, nerds are only technically competent.
Some self-proclaimed "nerds" (see KamikazeArchon) use the term to describe any person who is deeply interested in science, technology and/or mathematics.