My boyfriend has lost interest in sex

I've been seeing my boyfriend for 6 months and we used to have sex all the time, but recently he just isn't interested. I keep trying to make a move but he keeps blowing it off. I've tried everything! I tried to talk to him about it and he said he didnt know why and that he hadnt even noticed. He tells me that hes still attracted to me but I am really struggling to believe it.

Last night it started to get a bit heated for the first time in 2 weeks, we were talking dirty and he got really hard so I started to rub him through his pants and before it went any further he asked if we could just cuddle.

I don't know what to do!