Since August 2017, Asymptote has been integrated into MikTeX and therefore the previous answers are no longer valid.
For asymptote to work correctly under Texmaker, the asymptote command must be correctly initialized in Texmaker.
By default, it displays:
"C:/Program Files/Asymptote/asy.exe" %.asy
This is not the right path to the asymptote executable.
1. Found the MikTeX installation folder by clicking on the MikTeX console Settings Directoriestab
Asymptote is installed in the folder highlighted in yellow here, it is about C:\Program Files\MiKTeX 2.9\miktex\bin\x64

But, by default, MikTeX is installed in the folder
C:\Users\cs\AppData\Local\Programs\MikTeX2.9
Then just copy this path and add \asy.exe" %.asy
In my case, this is: C:\Program Files\MiKTeX 2.9\miktex\bin\x64\asy.exe %.asy
By default, you will get C:\Users\cs\AppData\Local\Programs\MikTeX2.9\miktex\bin\x64\asy.exe %.asy
2. Just configure Texmaker by clicking on configure

and then copy this path without forgetting the %.asy and it's over.
"C:\Program Files\MiKTeX 2.9\miktex\bin\x64\asy.exe" %.asy
3. New Year Update 2020.
I just wrote to Pascal Brachet, Texmaker developer, to change the default asymptote path on Texmaker.
Version 5.0.4 of Texmaker has just been released. The default paths to the asymptote executable asy.exe has been updated.
Translated with www.DeepL.com/Translator