I know it's easier said than done, but try not to worry overly about this aspect because if you put too much stress on yourselves it will only exasperate your situation.
Most men experience erection problems at some stage of their life and often it's a temporary thing with no obvious cause:
Don't have any expectations or put any more pressure on him to perform, tell him you feel happy to have a nice hug and try to feel more relaxed about your intimacy without necessarily worrying about ejaculation.
If it's a usual temporary situation, this approach could help, &/or you could also try viagra or similar (small amount at first) to help get things going again.
There are a number of other factors that can contribute to erection problems: stress (relationship, family, work etc), and physical problems like weight gain, diabities, lifestyle, poor circulation, smoking, alcohol causing "brewers' droop".
Most stress and health issues can be assisted by lifestyle changes, diet, moderate exercise etc.
Especially if there's potential for any underlying physical problem, you will need to obtain medical advice.