Just change the code to the following:
x = randn(1,1000);
h = [1 2 3 4 5];
y = conv(x,h);
plot((abs(fft(h,1024))).*(abs(fft(x,1024)))); % It's |H(w)||X(w)|
hold on
plot(abs(fft(y,1024)),'--r')
By mistake you raised the DFT of an impulse response to the second power. You could see that magnitudes are bit off, but peaks and valleys are more-less at the same point.

Additionally I've noticed in my MATLAB 2014a, that you get an error after running your original code. That's because vector x
was a row vector, and y
a column one.
This part is to answer Drazick, claiming that this approach will produce some errors (already present in my solution).
In @jojek code there is no equality since he neglected the phase by
applying the abs operator on both signals before the multiplication
(As opposed to the Convolution Theorem).
If the filter had a more harsh phase his result would have much bigger
error.
First of all please read my MATLAB code, maybe you will notice --r
switch in second plot function. I intentionally used a dashed line, otherwise we would have just red plot and no blue at all.
But let's cut to the chase. Code is now slightly modified, as random signal is being filtered by long filter with random coefficients. This is what we get for comparison of $|H(\omega)X(\omega)|$ and $|H(\omega)||X(\omega)|$ with convolution in time domain:

Let's zoom in:

So all three are equal. Also script provides maximum difference between two methods to be around $10^{-13}$. Below script to reproduce the results:
clc, close all
x = randn(1,1000);
h = randn(1,200); % some crazy filter
y = conv(x,h);
N = length(y);
Y = abs(fft(h,N)).*abs(fft(x,N)); % |H(w)||X(w)|
YY = abs(fft(h,N).*fft(x,N)); % |H(w)X(w)|
plot(YY,'go');
hold on
plot(Y,'b')
plot(abs(fft(y,N)),'--r')
grid on
legend({'|H(w)X(w)|','|H(w)||X(w)|','conv'})
display(sprintf('Max error: %e', max(abs(YY-Y))))