Yes this is true, we can prove this with the help of the fundamental groupoid of a topological space. The fundamental groupoid of $X$ is denoted $\pi_{\leq1}(X)$ and is a category whose objects are points in $X$ and (relative) homotopy classes of paths between points is your set of morphisms, composition is given by multiplication of paths, i.e traversing the first path at double speed and then the second path at double speed.
The important part about this category is that it is a groupoid, i.e all morphisms (paths) $p(t)$ have a two sided inverse (path) given by $p(1-t)$. It's important to note that $\text{Hom}(x_0,x_0) = \pi_1(X,x_0)$ since both are homotopy classes relative endpoints of paths from $x_0$ to $x_0$.
Let $x_0,a \in X$ be an arbitrary pair of points then we see that if $p$ is a path from $x_0$ to $a$ (which exists by contractibility of $X$), letting $[-]$ denote homotopy class relative endpoints, $[p]:x_0 \rightarrow a$ by definition.
We can also see that $[p]$ induces a bijection $[p]_*:\text{Hom}(x_0,x_0) \rightarrow \text{Hom}(x_0,a)$ given by $[f] \mapsto [p] \circ [f]$. This is a bijection since an inverse $[p]^{-1}$ to $[p]$ exists.
To prove injectivity if $[p] \circ [f] = [p] \circ [g]$ then $[p]^{-1} \circ [p] \circ [f] = [p]^{-1} \circ [p] \circ [g]$ which implies $[f] = [g]$, so $[p]_*$ is injective.
To prove surjectivity if $[q]:x_0 \rightarrow a$ we have that $[p] \circ ([p]^{-1} \ [q]) = [q]$ so $[p]_*$ is surjective.
Now that we have proved that $\text{Hom}(x_0,x_0) \approx \text{Hom}(x_0,a)$ we recall that $\text{Hom}(x_0,x_0) = \pi_1(X,x_0)$ but since $X$ is contractible $\pi_1(X,x_0)$ is a one element set. This imples that $\text{Hom}(x_0,a)$ is also a one element set and thus our fact is proven, there is only one homotopy class relative endpoints from $x_0$ to $a$. I.e any two paths which are equal on endpoints have a homotopy between them.
Note that we didn't need that $X$ was contractible, just that it was path and simply connected.
Hope this helps!
Here is a hint spelling out the desired nullhomotopy in detail.
Let $F:X \times I \to X$ be a homotopy with $F \mid_{X \times \{0\}}=Id_X$ and $F \mid_{X \times\{1\}}=c_x$, where $c_x:X \to X$ is a constant map $c_x(z)=x$ for all $z \in X$.
Let $g:Y \to X$ be an arbitrary continuous map.
Then define $G:Y \times I \to X$ by $G(y,t)=F(g(y),t)$.
This is a nullhomotopy from $g$ to a constant map.
Best Answer
Thm. If $X$ is locally compact and Hausdorff, the map $$ \Psi\colon C(X\times Z,Y)\to C(Z,C(X,Y)) $$ defined as $\Psi(H)(z)(x)=H(x,z)$, is a homeomorphism when the spaces of continuous functions are given the compact-open topology.
Proof: Lecture 12: Function spaces (part 4).
Apply this result to the case $Z=[0,1]$ to get a homeomorphism $$ \Psi\colon C(X\times[0,1],Y)\to C([0,1],C(X,Y)) $$
Note that the hypothesis on $X$ is automatically fulfilled for paths and loops: In the former case $X$ is an interval $I$ (usually $[0,1]$) and in the latter $\mathbb S^1$. In other words, $$ C(I\times[0,1],X)\to C([0,1],C(I,X))$$ and $$ C(\mathbb S^1\times[0,1],X)\to C([0,1],C(\mathbb S^1,X)) $$ are homeomorphisms for any topological space $X$.
A second theorem shows that when $K$ is compact and $X$ metric, the compact-open topology of $C(K,X)$ agrees with the topology induced by the distance between functions $$ d(f,g)=\sup\{d(f(\zeta),g(\zeta))\mid\zeta\in K\}. $$ Thus, given that $I$, $[0,1]$ and $\mathbb S^1$ are compact, when $X$ is a metric space, $\Psi$ can bee seen as a homeomorphism of metric spaces.