To clear up some confusion:
The title of this thread is somewhat ambiguous, as there are two possible meaning for “holding molecules together.” It could refer either to the force within a molecule, or the force between molecules.
I think that @XOIIO is talking about the first option, while @mattbrowne is talking about the second option.
I’m going to tackle the second question, since it is much simpler (less quantum physics), and it seems to be the question described in the details (with surface tension).
——
The force responsible for the attraction between water molecules is the electrical force.
Molecules have a three dimensional shape. Within that shape there are X number of protons (positive charge) and the same number of electrons (negative charge).
On the scale of everyday life, those protons and electrons are almost in the exact same location (the molecule appears to be a point). This means that the charges balance out and the molecule is electrically neutral.
Molecules, however, are a scale small enough such that the 3D shape of the molecules becomes important. Even though the amount of negative and positive charge cancels out within each molecule, the negative and positive charges aren’t evenly distributed.
Water is a polar molecule. This means that one side of the molecule (in this case the oxygen side) has negative charge, and the other side (where the hydrogen is) has a positive charge. When several water molecules are next to each other, the negative part of one molecule is attracted to the positive part of the other molecule. This is a very weak attraction, but it is enough.
Here’s how surface tension works: Water molecules in the interior are surrounded on all sides experience an equal pull in all directions, which cancels out. The molecules that are on the surface of a droplet, however, are only surrounded on one side. They are only pulled in one direction, which is not canceled out. This unbalanced electrical pull causes the surface molecules have a higher potential energy. To minimize potential energy, water droplets try to minimize surface area. That creates all of the effects of surface tension.